package UMC.Web;


import java.util.Arrays;
import java.util.LinkedList;
import java.util.List;

public class UIFootBar extends UIHeader {
    List<Object> _icons = new LinkedList<>();
    List<Object> _buttons = new LinkedList<>();

    public UIFootBar cart() {
        _icons.add("-");
        if (this.meta.containsKey("icons") == false) {
            this.meta.put("icons", _icons);
        }
        return this;
    }

    public UIFootBar setLineColor(int color) {
        this.meta.put("line-color", UIStyle.parseColor(color));
        return this;
    }

    public UIFootBar text(UIEventText... text) {
        _buttons.addAll(Arrays.asList(text));
        if (this.meta.containsKey("buttons") == false) {
            this.meta.put("buttons", _buttons);
        }
        return this;

    }

    public UIFootBar icon(UIEventText... icons) {
        _icons.addAll(Arrays.asList(icons));
        if (this.meta.containsKey("icons") == false) {
            this.meta.put("icons", _icons);
        }
        return this;

    }

    public boolean fixed() {

        return this.meta.containsKey("fixed");
    }

    public UIFootBar fixed(boolean value) {
        if (value) {
            this.meta.put("fixed", true);
        } else {
            this.meta.remove("fixed");

        }
        return this;
    }
}